Gets a new
Leadtools.RasterViewPerspective that results from applying a
PlaneOrientation to a given
Leadtools.RasterViewPerspective and two given direction cosine vectors.
Syntax
Example
This example does the following:
- Creates a coronal PlaneOrientation that corresponds to a horizontal flip
- Defines orientation vectors that corresonds to a coronal slice
- Applies the above to a view perspective, and returns the resulting view perspective
Visual Basic | Copy Code |
---|
<Test> _
Public Sub GetNewViewPerspectiveExample()
' Create a new coronal PlaneOrientation that corresponds to a horizontal flip
Dim poCoronal As New PlaneOrientation()
poCoronal.Name = "Coronal or Frontal"
' This corresponds to a horizontal flip
poCoronal.Top = OrientationAxis.Inferior
poCoronal.Right = OrientationAxis.Right
' This condition is ignored
Dim condition As New TagValueOrientationCondition(DicomTag.ImageOrientationPatient, Nothing)
poCoronal.Condition = condition
' This specifies a row and column orientation vector that correspond to a coronal slice
' Row: (1,0,0)
' Col: (0,0,-1)
Dim imageOrientationVectors() As Double = { 1, 0, 0, 0, 0, -1 }
' Find the new view perspective
Dim newViewPerspective As RasterViewPerspective = DicomExtensions.GetNewViewPerspective(RasterViewPerspective.TopLeft, imageOrientationVectors, poCoronal)
' New view perspective should be BottomLeft
MessageBox.Show("newViewPerspective should be BottomLeft" & Constants.vbLf & "Actual newViewPerspective is " & newViewPerspective.ToString())
End Sub |
C# | Copy Code |
---|
public void GetNewViewPerspectiveExample()
{
// Create a new coronal PlaneOrientation that corresponds to a horizontal flip
PlaneOrientation poCoronal = new PlaneOrientation();
poCoronal.Name = "Coronal or Frontal";
// This corresponds to a horizontal flip
poCoronal.Top = OrientationAxis.Inferior;
poCoronal.Right = OrientationAxis.Right;
// This condition is ignored
TagValueOrientationCondition condition = new TagValueOrientationCondition(DicomTag.ImageOrientationPatient, null);
poCoronal.Condition = condition;
// This specifies a row and column orientation vector that correspond to a coronal slice
// Row: (1,0,0)
// Col: (0,0,-1)
double[] imageOrientationVectors = new double[6] { 1, 0, 0, 0, 0, -1 };
// Find the new view perspective
RasterViewPerspective newViewPerspective = DicomExtensions.GetNewViewPerspective(RasterViewPerspective.TopLeft, imageOrientationVectors, poCoronal);
// New view perspective should be BottomLeft
MessageBox.Show("newViewPerspective should be BottomLeft\nActual newViewPerspective is " + newViewPerspective.ToString());
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7
See Also